package com.woniuxy.cloud.carl.car.client;

import com.woniuxy.cloud.carl.car.client.param.GetCarByConditionParam;
import com.woniuxy.cloud.carl.car.client.param.GetCarByYearParam;
import com.woniuxy.cloud.carl.car.client.param.GetStyleParam;
import com.woniuxy.cloud.carl.car.client.result.CarForStationDto;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "carQueryClient",name="car",path="car")
public interface CarQueryClient {
    // 品牌 --车系 -- 排量 -- 车型 -- 生产年份 --car
    @GetMapping("byConditionForStation")
    public Result getCars(@SpringQueryMap GetCarByConditionParam param);


    @GetMapping("carSortByBrand")
    public Result getSortsByBrandId(@RequestParam("carBrandId") Long carBrandId);

    @GetMapping("carStyleBySort")
    public Result getStyleBySort(@SpringQueryMap GetStyleParam param);

    @GetMapping("byCarStyle")
    public Result getCarByStyleId(@SpringQueryMap GetCarByYearParam param);

    @GetMapping("allBrand")
    public Result getBrands();

    @GetMapping("carDetailById")
    public Result<CarForStationDto> getDetail(@RequestParam("carId") Long carId);


    @GetMapping("productYear")
    public Result getYearByStyleId(@RequestParam("carStyleId") Long carStyleId); //获得所有年份

    @GetMapping("displacement")
    public Result getDisplacementBySortId(@RequestParam("carSortId") Long carSortId); //获得所有排量


}
